$hideLiu = $registration->getFilter( 'hideliu' );
$hideLiu->setDefault( $user->getBoolOption( 'watchlisthideliu' ) );
+ // Selecting both hideanons and hideliu on watchlist preferances
+ // gives mutually exclusive filters, so those are ignored
+ if ( $user->getBoolOption( 'watchlisthideanons' ) &&
+ !$user->getBoolOption( 'watchlisthideliu' )
+ ) {
+ $this->getFilterGroup( 'userExpLevel' )
+ ->setDefault( 'registered' );
+ }
+
+ if ( $user->getBoolOption( 'watchlisthideliu' ) &&
+ !$user->getBoolOption( 'watchlisthideanons' )
+ ) {
+ $this->getFilterGroup( 'userExpLevel' )
+ ->setDefault( 'unregistered' );
+ }
+
$reviewStatus = $this->getFilterGroup( 'reviewStatus' );
if ( $reviewStatus !== null ) {
// Conditional on feature being available and rights
// Second two overriden
'hideanons' => false,
'hideliu' => true,
+ 'userExpLevel' => 'registered'
] + $wikiDefaults,
[
'watchlisthideminor' => 1,
'hidebots' => true,
'hideanons' => false,
'hideliu' => true,
+ 'userExpLevel' => 'unregistered'
] + $allFalse,
[
'watchlisthideminor' => 0,
'watchlisthidebots' => 1,
- 'watchlisthideanons' => 1,
- 'watchlisthideliu' => 0,
+
+ 'watchlisthideanons' => 0,
+ 'watchlisthideliu' => 1,
],
[
'hidebots' => 1,